﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace WisDom.Models
{
    /// <summary>
    /// 备份客户端文件 
    /// </summary>
    public class BackupClientFileEntity : BaseEntity
    {
        /// <summary>
        /// 文件编号
        /// </summary>
        public int FileId { get; set; }
        /// <summary>
        /// 文件名称
        /// </summary>
        public string FileName { get; set; }

        /// <summary>
        /// 客户端Ip地址
        /// </summary>
        public string ClientIp { get; set; }
        /// <summary>
        /// 备份路径
        /// </summary>
        public string FilePath { get; set; }

        /// <summary>
        ///备份类型名称
        /// </summary>
        public string BackupTypeString
        {
            get { return BackupType.ToString(); }
            set
            {

                BackupType = Enum.Parse<BackupType>(value, true);
            }
        }

        /// <summary>
        /// 描述
        /// </summary>
        public string Remark { get; set; }

        [NotMapped]
        public BackupType BackupType { get; set; }

        public override void CalcPrimaryKey()
        {
            //throw new NotImplementedException();
        }

    }


    /// <summary>
    /// 备份类型
    /// </summary>
    public enum BackupType
    {
        DB = 1,
        File = 2,
    }
}
